package com.itheima.demo001;

public class exercise32 {
    public static void main(String[] args) {
        //带返回值
        //直接调用，适合于没有返回值的
        //赋值调用
        int sum0 = getSum(10,20,30);
        System.out.println(sum0);
        //输出调用
        System.out.println(getSum(10,20,30));

        //四个季度的营业额
        int sum1 = getSum(10,20,30);
        int sum2 = getSum(20,30,40);
        int sum3 = getSum(30,40,50);
        int sum4 = getSum(20,30,40);

        //求全年的总营业额
        int sum = sum1 + sum2 + sum3 + sum4;
        System.out.println(sum);
    }
    public static int getSum(int num1,int num2,int num3){
        int result = num1 + num2 + num3;
        return result;//返回给方法的调用处
    }
}
